<%--
  Created by IntelliJ IDEA.
  User: ASUS
  Date: 2021/4/25
  Time: 20:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
  <head>
    <title>Index</title>
    <style>
      a{
        text-decoration: none;
        color: #0000ff;
      }
      span{
        color: #ef2f89;
      }
      .welcome{
        float: left;
      }
      img{
        max-width: 70px;
        max-height: 70px;
      }
    </style>
  </head>
  <body>
    <c:choose>
      <c:when test="${sessionScope.username == null || sessionScope.username.equals(\"\")}">
        <h1>您还未登录或登录已过期，请前往登录：</h1>
        <h1><a href="login">登录</a></h1>
      </c:when>
      <c:otherwise>
        <h3 class="welcome">欢迎你,${username}</h3><img alt="头像" title="头像" src="img?username=${username}">
        <h3>当前在线人数为 <span>${onLineNum}</span> 人</h3>
      </c:otherwise>
    </c:choose>
  </body>
</html>
